<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
  <meta charset="UTF-8">
  <title></title>
  <script th:src="@{/layui/layui.js}" type="text/javascript"></script>
  <link th:href="@{/layui/css/layui.css}" rel="stylesheet" />
</head>
<body>
<div class="layui-container" style="margin: 10px 0px; ">
  <form class="layui-form layui-form-pane">
    <input type="hidden" name="id" th:value="${fd.id}">
    <div class="layui-form-item">
      <label class="layui-form-label">用户名</label>
      <div class="layui-input-block" style="width: 225px;">
        <input type="text" class="layui-input" name="user"  th:value="${fd.user}"   autocomplete="off" />
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label">手机号码</label>
      <div class="layui-input-block" style="width: 225px;">
        <input type="text" class="layui-input" name="phone"  th:value="${fd.phone}" autocomplete="off" />
      </div>

    </div>
    <div class="layui-form-item">
      <label class="layui-form-label">反馈类型</label>
      <div class="layui-input-block" style="width: 225px;">
        <select  type="text" id="type" class="layui-input"  name="type" th:value="${fd.type}" autocomplete="off" >
          <option th:selected="${fd.type}=='1'" value="1" >七天无理由</option>
          <option th:selected="${fd.type}=='2'" value="2" >卖家发错货</option>
          <option th:selected="${fd.type}=='3'" value="3" >尺码不合适</option>
        </select>
      </div>
    </div>
    <div class="layui-form-item layui-form-text" >
      <label class="layui-form-label">反馈内容</label>
      <div class="layui-input-block" >
        <textarea  class="layui-textarea" name="content"  th:text="${fd.content}"  autocomplete="off" />
      </div>
    </div>


    <div class="layui-form-item" style="display: none;">
      <div class="layui-input-block">
        <a class="layui-btn" id="submitBtn" lay-submit="" lay-filter="submitBtn">提交</a>
      </div>
    </div>
  </form>
</div>
<script>

  var $;
  layui.use(['table','layer','form','jquery','dropdown','element'],function() {
    var table = layui.table,
            form = layui.form,
            element = layui.element,
            layer = layui.layer,
            dropdown= layui.dropdown;
    $ = layui.jquery;


    form.on('submit(submitBtn)',function (data) {
      var formData = data.field;
      $.ajax({
        type:'post',
        url:'/feedback/fc/update',
        data:formData,
        dataType:'json',
        success:function (result) {
          layer.msg(result.msg);
          if(result.is){
            let index = parent.layer.getFrameIndex(window.name);
            parent.layer.close(index);//关闭父页面窗口
          }
        }
      })
    });

  });
  function btnSubmit(){
    $('#submitBtn').click();
  }

</script>
</body>
</html>
